
using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class View_RepariOrdersMap : EntityTypeConfiguration<View_RepariOrders>
    {
        public View_RepariOrdersMap()
        {
            // Primary Key
            this.HasKey(t => new { t.ID });

            // Properties


            this.Property(t => t.REPAIR_ORDER_NO)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.OBU_NO)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(16);

            this.Property(t => t.USER_NO)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(16);

            this.Property(t => t.USER_NAME)
                .HasMaxLength(120);

            this.Property(t => t.OWNER_NAME)
                .HasMaxLength(120);

            this.Property(t => t.SUPPLIER)
                .HasMaxLength(200);
            this.Property(t => t.SUPPLIER_ShortName)
                .HasMaxLength(100);

            this.Property(t => t.SPEC_NAME)
                .HasMaxLength(50);

            this.Property(t => t.REPORTER)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.TEL_NO)
                .HasMaxLength(50);

            this.Property(t => t.MOBILE_TEL_NO)
                .HasMaxLength(50);

            this.Property(t => t.AGENT_NO)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(16);

            this.Property(t => t.AGENT_NAME)
                .HasMaxLength(50);

            this.Property(t => t.CLIENT_IP)
                .HasMaxLength(200);

            this.Property(t => t.FACE_STATUSTitle)
                .IsRequired()
                .HasMaxLength(8);

            this.Property(t => t.REPAIRED_COMMENT)
                .HasMaxLength(50);

            this.Property(t => t.IsFreeTitle)
                .IsRequired()
                .HasMaxLength(2);

            this.Property(t => t.IsNeedSPARE_OBU)
                .IsRequired()
                .HasMaxLength(2);

            this.Property(t => t.SPARE_OBU_NO)
                .IsFixedLength()
                .HasMaxLength(16);



            this.Property(t => t.StatusTitle)
                .HasMaxLength(50);

            this.Property(t => t.CURRENT_HANDLER)
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.CONFIRM_REPAIRED_Title)
                .IsRequired()
                .HasMaxLength(6);



            this.Property(t => t.DISPOSE_TYPE_Title)
                .HasMaxLength(50);

            this.Property(t => t.IS_RETURNED_SPARE_OBU_Title)
                .IsRequired()
                .HasMaxLength(2);

            this.Property(t => t.RETURNED_COMMENT)
                .HasMaxLength(200);

            this.Property(t => t.CREATED_BY)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.CreatedByName)
                .HasMaxLength(50);

            this.Property(t => t.MODIFY_BY)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.ModifyByName)
                .HasMaxLength(50);

            this.Property(t => t.VEHICLE_PLATE_NO)
                .HasMaxLength(12);

            // Table & Column Mappings
            this.ToTable("View_RepariOrders");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.REPAIR_ORDER_NO).HasColumnName("REPAIR_ORDER_NO");
            this.Property(t => t.OBU_NO).HasColumnName("OBU_NO");
            this.Property(t => t.USER_NO).HasColumnName("USER_NO");
            this.Property(t => t.USER_NAME).HasColumnName("USER_NAME");
            this.Property(t => t.OWNER_NAME).HasColumnName("OWNER_NAME");
            this.Property(t => t.SUPPLIER).HasColumnName("SUPPLIER");
            this.Property(t => t.SUPPLIER_ShortName).HasColumnName("SUPPLIER_ShortName");
            this.Property(t => t.SUPPLIERS_ID).HasColumnName("SUPPLIERS_ID");
            this.Property(t => t.SPEC_NAME).HasColumnName("SPEC_NAME");
            this.Property(t => t.REGISTER_DATE).HasColumnName("REGISTER_DATE");
            this.Property(t => t.REPORTER).HasColumnName("REPORTER");
            this.Property(t => t.TEL_NO).HasColumnName("TEL_NO");
            this.Property(t => t.MOBILE_TEL_NO).HasColumnName("MOBILE_TEL_NO");
            this.Property(t => t.MAX_PRICE).HasColumnName("MAX_PRICE");
            this.Property(t => t.AGENT_NO).HasColumnName("AGENT_NO");
            this.Property(t => t.AGENT_NAME).HasColumnName("AGENT_NAME");
            this.Property(t => t.CLIENT_IP).HasColumnName("CLIENT_IP");
            this.Property(t => t.FACE_STATUS).HasColumnName("FACE_STATUS");
            this.Property(t => t.FACE_STATUSTitle).HasColumnName("FACE_STATUSTitle");
            this.Property(t => t.REPAIR_TYPE).HasColumnName("REPAIR_TYPE");
            this.Property(t => t.REPAIR_TYPE_Title).HasColumnName("REPAIR_TYPE_Title");
            this.Property(t => t.REPAIRED_COMMENT).HasColumnName("REPAIRED_COMMENT");
            this.Property(t => t.IS_FREE).HasColumnName("IS_FREE");
            this.Property(t => t.IsFreeTitle).HasColumnName("IsFreeTitle");
            this.Property(t => t.IsNeedSPARE_OBU).HasColumnName("IsNeedSPARE_OBU");
            this.Property(t => t.SPARE_OBU_NO).HasColumnName("SPARE_OBU_NO");
            this.Property(t => t.SPARE_OBU_PRICE).HasColumnName("SPARE_OBU_PRICE");
            this.Property(t => t.SPARE_OBU_ISSUE_DATE).HasColumnName("SPARE_OBU_ISSUE_DATE");
            this.Property(t => t.STATUS).HasColumnName("STATUS");
            this.Property(t => t.StatusTitle).HasColumnName("StatusTitle");
            this.Property(t => t.CURRENT_HANDLER).HasColumnName("CURRENT_HANDLER");
            this.Property(t => t.CONFIRM_REPAIRED).HasColumnName("CONFIRM_REPAIRED");
            this.Property(t => t.CONFIRM_REPAIRED_Title).HasColumnName("CONFIRM_REPAIRED_Title");
            this.Property(t => t.DISPOSE_TYPE).HasColumnName("DISPOSE_TYPE");
            this.Property(t => t.DISPOSE_TYPE_Title).HasColumnName("DISPOSE_TYPE_Title");
            this.Property(t => t.FINISHED_DATE).HasColumnName("FINISHED_DATE");
            this.Property(t => t.GET_BACK_DATE).HasColumnName("GET_BACK_DATE");
            this.Property(t => t.IS_RETURNED_SPARE_OBU).HasColumnName("IS_RETURNED_SPARE_OBU");
            this.Property(t => t.IS_RETURNED_SPARE_OBU_Title).HasColumnName("IS_RETURNED_SPARE_OBU_Title");
            this.Property(t => t.RETURNED_COMMENT).HasColumnName("RETURNED_COMMENT");
            this.Property(t => t.CREATED_BY).HasColumnName("CREATED_BY");
            this.Property(t => t.CreatedByName).HasColumnName("CreatedByName");
            this.Property(t => t.CREATED_DATE).HasColumnName("CREATED_DATE");
            this.Property(t => t.MODIFY_BY).HasColumnName("MODIFY_BY");
            this.Property(t => t.ModifyByName).HasColumnName("ModifyByName");
            this.Property(t => t.MODIFY_DATE).HasColumnName("MODIFY_DATE");
            this.Property(t => t.VEHICLE_PLATE_NO).HasColumnName("VEHICLE_PLATE_NO");
            this.Property(t => t.VEHICLE_CLASS).HasColumnName("VEHICLE_CLASS");
            this.Property(t => t.VEHICLE_CLASS_NAME).HasColumnName("VEHICLE_CLASS_NAME");
        }
    }
}
